package com.jubaozan.reward.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jubaozan.reward.dao.entity.AgencyAncestorDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 服务商祖先链
 */
public interface AgencyAncestorMapper extends BaseMapper<AgencyAncestorDO> {


    @Select("CALL select_agency_ancestors(#{userId}, #{time}, #{tenantId})")
    List<AgencyAncestorDO> selectAncestors(@Param("userId") Long userId,
                                           @Param("time") LocalDateTime time,
                                           @Param("tenantId") Long tenantId);
}
